package com.getan.boot.module.system.domain.bo;

import com.getan.boot.common.domain.GenericBO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 字典管理
 *
 * @author Bruce.Gong
 * @since 1.0.0-SNAPSHOT
 */
public interface DictBO {

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class TypeAddBO extends GenericBO {
        @NotEmpty(message = "字典类型不能为空")
        private String type;
        @NotEmpty(message = "字典名不能为空")
        private String name;
        private String remark;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class TypeUpdateBO extends GenericBO {
        @NotNull(message = "ID不能为空")
        private Long id;
        @NotEmpty(message = "字典名不能为空")
        private String name;
        private String remark;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class AddBO extends GenericBO {
        @NotNull(message = "字典类型不能为空")
        private Long typeId;
        @NotEmpty(message = "字典项编码不能为空")
        private String code;
        @NotEmpty(message = "字典值不能为空")
        private String value;
        private Integer sort;
        private String extra;
        private String remark;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class UpdateBO extends GenericBO {
        @NotNull(message = "ID不能为空")
        private Long id;
        @NotEmpty(message = "字典值不能为空")
        private String value;
        private Integer sort;
        private String extra;
        private String remark;
    }

}
